package logic.studentQuery_logic;

import javaRMI.RMIClient;

import logicsv.studentQuery_logicsv.StudentQueryLogicsv;
import po.StudentPO;
import resultmessage.StudentQueryRM;
import vo.StudentVO;

public class StudentQueryLogicsvController implements StudentQueryLogicsv{
	private RMIClient rmi;
	public StudentQueryLogicsvController(RMIClient rmi) {
	super();
	this.rmi = rmi;
}

	@Override
	public StudentVO getStudent(String studentID) {
		CollegeStudentList collegeStudentList = new CollegeStudentList(rmi,studentID.substring(0, 3));
		return collegeStudentList.getStudent(studentID);
	}

	@Override
	public StudentQueryRM addStudent(StudentPO student) {
		CollegeStudentList collegeStudentList = new CollegeStudentList(rmi,student.getCollegeID());
		return collegeStudentList.addStudent(student);
	}

	@Override
	public StudentQueryRM updateStudent(StudentPO student){
		// TODO Auto-generated method stub
		CollegeStudentList collegeStudentList = new CollegeStudentList(rmi,student.getCollegeID());
		return collegeStudentList.updateStudent(student);
	}

	@Override
	public StudentQueryRM deleteStudent(String collegeID,String studentID){
		// TODO Auto-generated method stub
		CollegeStudentList collegeStudentList = new CollegeStudentList(rmi,collegeID);
		return collegeStudentList.deleteStudent(studentID);
	}
}
